package com.frkj.order.controller;

import com.frkj.order.model.HistoryOrder;
import com.frkj.order.vo.FullQueueInfo;
import com.jfinal.core.Controller;
import org.joda.time.DateTime;

import java.util.List;

/**
 * Create-Date: 2016/6/29
 * Description:
 */
public class HistoryOrderController extends Controller {

    public void index() {
        int monthScope = getParaToInt("monthScope", 1);
        DateTime nowTime = new DateTime();
        DateTime startTime = nowTime.plusMonths(0 - monthScope);

        List<FullQueueInfo> fullQueueInfoList = HistoryOrder.me.getFullQueueInfo(startTime.toDate(), nowTime.toDate());
        setAttr("fullQueueInfoList", fullQueueInfoList);
        setAttr("monthScope", monthScope);
        render("index.html");
    }

}
